<?php
/*  
  Copyright (c) 2010-02 SongCMS 
  SongCMS All Rights Reserved. 
  Support:www.SongCMS.com
  QQ:544255858   19951025
  Author:Song  Version:3.17
  Date:2010-08-12 09:28:32
*/

include_once('Admin.php');
include_once('../config/field.php');
$ColumnType = 1; //栏目类型:0栏目内容分类,1新闻分类,2产品分类
$product_field = $customize_field['product']; //自定义字段
if (!is_numeric($_GET['ID'])) {MsgBox (1,'非数字错误！','-1');}
$aRs = $db->SelectSQL("SELECT * FROM `{$dbprefix}product` WHERE `ID` = '" . $_GET['ID'] . "'",1);
if(count($aRs)==0){MsgBox (1,'不存在的产品！','-1');}
$aRs = array_shift($aRs);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="./images/adminstyle.css" rel="stylesheet" type="text/css" />
<link rel="Shortcut Icon" href="../favicon.ico">
<link rel="Bookmark" href="../favicon.ico">
<script src="../js/csshovernotie6.js" type="text/javascript"></script>
<script src="../tools/highslide/highslide.js" type="text/javascript"></script>
<script type="text/javascript">
hs.graphicsDir = '../tools/highslide/graphics/';
hs.showCredits = false;
hs.outlineType = 'rounded-white';
hs.restoreTitle = '关闭';
</script>
</head>
<body>
<br />
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr class="Notodd"><td align="right">
		<input type="button" value="添加产品" onClick="javascript:location.href='ProductAdd.php?Lang=<?php echo $Lang?>'">
		<input type="button" value="产品管理" onClick="javascript:location.href='ProductManage.php?Lang=<?php echo $Lang?>'">		
		<input type="button" value="类别管理" onClick="javascript:location.href='ProductColumnManage.php?Lang=<?php echo $Lang?>'">	
	</td></tr>
</table>
<table width="98%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#CCCCCC">
  <tr class="odd">
    <td colspan="2" align="center" class="Main_Title">产品预览<?php echo $OnWebLangName?></td>
  </tr>
  <tr class="odd">
    <td width="120" align="right">产品类别：</td>
    <td><?php echo htmlspecialchars(ArticleName($aRs['ProductRela']))?></td>
  </tr>
  <tr class="odd">
    <td align="right">产品标题：</td>
    <td><?php if(empty($aRs['ProductNameColor'])) echo $aRs['ProductName']; else echo '<font color="' . $aRs['ProductNameColor'] . '">' . $aRs['ProductName'] . '</font>';?></td>
  </tr>
<?php if($ConfigProductBrand == 1){?>
  <tr class="odd">
    <td align="right">产品品牌：</td>
    <td><?php echo $aRs['ProductBrand']?></td>
  </tr>
<?php } if($ConfigProductModel == 1){?>
  <tr class="odd">
    <td align="right">产品型号：</td>
    <td><?php echo $aRs['ProductModel']?></td>
  </tr>
<?php } if($ConfigProductCoding == 1){?>
  <tr class="odd">
    <td align="right">产品编码：</td>
    <td><?php echo $aRs['ProductCoding']?></td>
  </tr>
<?php } if($ConfigProductSpeci == 1){?>  
  <tr class="odd">
    <td align="right">产品规格：</td>
    <td><?php echo $aRs['ProductSpeci']?></td>
  </tr>  
<?php } if($ConfigProductColor == 1){?>  
  <tr class="odd">
    <td align="right">产品颜色：</td>
    <td><?php echo $aRs['ProductColor']?></td>
  </tr>   
<?php } if($ConfigProductPrice == 1){?>  
  <tr class="odd">
    <td align="right">产品价格：</td>
    <td><?php echo $aRs['ProductPrice']?></td>
  </tr>    
<?php } if($ConfigProductKeyWord == 1){?>  
  <tr class="odd">
    <td align="right">关 键 字：</td>
    <td><?php echo $aRs['ProductKeyWord']?></td>
  </tr>  
<?php } if($ConfigProductPhoto1 == 1){?>  
  <tr class="odd">
    <td align="right">产品小图：</td>
    <td>
<?php
$ps1 = "../{$aRs['ProductPhoto1']}";
if(is_file($ps1)){
	echo "<a href=\"{$ps1}\" onclick=\"return hs.expand(this);\"><img src=\"{$ps1}\" width=\"160\" border=\"0\"></a>";
} else {
	echo '<img src="images/noimg.gif" width="150" height="150" border="0" />';	
}
?>	
	</td>
  </tr>    
<?php } if($ConfigProductPhoto2 == 1){?>  
  <tr class="odd">
    <td align="right">产品大图：</td>
    <td>
<?php
$ps2 = "../{$aRs['ProductPhoto2']}";
if(is_file($ps2)){
	echo "<a href=\"{$ps2}\" onclick=\"return hs.expand(this);\"><img src=\"{$ps2}\" width=\"300\" border=\"0\"></a>";
} else {
	echo '<img src="images/noimg.gif" width="150" height="150" border="0" />';	
}
?>	
	
	</td>
  </tr>    
<?php } if($ConfigProductSummary == 1){?>  
  <tr class="odd">
    <td align="right">简要描述：</td>
    <td><?php echo $aRs['ProductSummary']?></td>
  </tr>    
<?php } 
//自定义字段
foreach ($product_field as $i => $n){
	echo "<tr class=\"odd\">
    <td align=\"right\">{$n[1]}：</td>
    <td>{$aRs[$n[0]]}</td>
	</tr>";
}
//End

if($ConfigProductContent == 1){?>  
  <tr class="odd">
    <td align="right">详细介绍：</td>
    <td><?php echo $aRs['ProductContent']?></td>
  </tr>    
<?php } if($ConfigProductSecrecy == 1){?>  
  <tr class="odd">
    <td align="right">查看权限：</td>
    <td><!-- 废弃的功能 --></td>
  </tr>    
<?php } if($ConfigProductNew == 1){?>  
  <tr class="odd">
    <td align="right">新 产 品：</td>
    <td><?php if($aRs['ProductNew']==0) echo '否'; else echo '是';?></td>
  </tr>    
<?php } if($ConfigProductRecommended == 1){?>  
  <tr class="odd">
    <td align="right">推荐产品：</td>
    <td><?php if($aRs['ProductRecommended']==0) echo '否'; else echo '是';?></td>
  </tr>    
<?php } if($ConfigProductAudit == 1){?>  
  <tr class="odd">
    <td align="right">审核状态：</td>
    <td><?php if($aRs['ProductAudit']==1) echo '通过审核'; else echo '未通过';?></td>
  </tr>    
<?php } if($ConfigProductClick == 1){?>  
  <tr class="odd">
    <td align="right">点 击 数：</td>
    <td><?php echo $aRs['ProductClick']?></td>
  </tr>  
<?php } if($ConfigProductSort == 1){?>  
  <tr class="odd">
    <td align="right">排 序 数：</td>
    <td><?php echo $aRs['ProductSort']?></td>
  </tr>  
<?php } if($ConfigProductPublished == 1){?>  
  <tr class="odd">
    <td align="right">添 加 人：</td>
    <td><?php echo $aRs['ProductPublished']?></td>
  </tr>  
<?php } if($ConfigProductTime == 1){?>  
  <tr class="odd">
    <td align="right">添加时间：</td>
    <td><?php echo $aRs['ProductTime']?></td>
  </tr>  
<?php }?>
  <tr class="odd">
    <td align="right">&nbsp;</td>
    <td><input type="button" value="返 回" class="submit" name="xxx0" onclick="history.back(-1)">
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="button" value="修 改" class="submit" onClick="javascript:location.href='ProductUpDate.php?Lang=<?php echo $Lang?>&ID=<?php echo $_GET['ID']?>';">
    </td>
  </tr>
</table>
<?php unset($aRs);  ?>
</body>
</html>
